﻿using System.Windows.Controls;
using IntoStationSystem.ViewModels;

namespace IntoStationSystem.Views
{
    /// <summary>
    /// IOState.xaml 的交互逻辑
    /// </summary>
    public partial class IOStateView : UserControl
    {
        IOStateViewModel vm => Locator.Instance.IOStateVM;
        public IOStateView()
        {
            InitializeComponent();
            this.DataContext = vm;
        }

        private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            vm.SetPage(vm.Page);
        }

        private void UserControl_Unloaded(object sender, System.Windows.RoutedEventArgs e)
        {
            vm.SetPage(0);
        }
        private void UserControl_ChageSingleInforMation(object sender, System.Windows.RoutedEventArgs e)
        {
            vm.SaveSingleToExcel();
        }
    }
}
